	<?php
defined('_JEXEC') OR die('Access Denied!');
### Copyright (c) 2006-2012 Joobi Limited. All rights reserved.
### license GNU GPLv3 , link http://www.joobi.co

class JElementVmfields extends JElement{
	function fetchElement($name, $value, &$node, $control_name){
		$db =& JFactory::getDBO();

		$fields = reset($db->getTableFields('#__vm_user_info'));
		$dropdown = array();
		foreach($fields as $oneField => $fieldType){
			$dropdown[] = JHTML::_('select.option', $oneField,$oneField);
		}
		return JHTML::_('select.genericlist', $dropdown, $control_name.'['.$name.']' , 'size="1"', 'value', 'text', $value);
	}
}
